import React from 'react';

interface ImageFallbackProps {
    src: string;
    fallbackSrc: string;
    alt?: string;
  }

  const ImageFallback: React.FC<ImageFallbackProps> = ({ src, fallbackSrc, alt = '加载失败' }) => (
  <img 
    src={src} 
    onError={(e) => { (e.target as HTMLImageElement).src = fallbackSrc }} 
    alt={alt} 
  />
);

export default ImageFallback;